package cn.yunhe.service;

import cn.yunhe.dao.IAdminDao;
import cn.yunhe.util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

public class UpAdminService {
    SqlSession session= null;
    IAdminDao iAdminDao=null;

    public int upAdmin(int id){
        int row=0;
        try{
        session= SqlSessionFactoryUtil.getSqlSession();
        iAdminDao=session.getMapper(IAdminDao.class);
        row=iAdminDao.upAdmin(id);
        session.commit();
        }finally {
            session.close();
        }
        return row;
    }

}
